//
//  AudioStream.h
//  FilterModule_Standalone
//
//  Created by kadlubek47 on 21.08.2013.
//  Copyright (c) 2013 kadlubek47. All rights reserved.
//

#ifndef __FilterModule_Standalone__AudioStream__
#define __FilterModule_Standalone__AudioStream__

#include <iostream>
#include "FMTypes.h"
#include "AudioFileIOManager_libsndfile.h"
#include "ChannelsInOut.h"


class AudioStream {
public:
    
    ChannelsInOut<float_type> channels_blocks_;
    
    AudioStream (std::string fileName, unsigned int blockSize);
    ~AudioStream();
    
    bool nextBlock();
    void close(std::string fileName);
    
    //get
    unsigned int get_blockSize()    { return channels_blocks_.channelLength_; }
    unsigned int get_sampleRate()   { return sampleRate_; }
    unsigned int get_numOfChannels(){ return channels_.numOfChannels_; }
    unsigned int get_numOfBlocks()  { return numOfBlocks_; }
    //.
    
private:
    ChannelsInOut<float_type> channels_;
    unsigned int sampleRate_  = 0;
    unsigned int    i_block_  = 0;
    unsigned int numOfBlocks_ = 0;
    
    AudioFileIOManager_libsndfile fileIOManager_;
    
};

#endif /* defined(__FilterModule_Standalone__AudioStream__) */
